View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001509 | T99X171.00 SKB Eagle | SW Issue | public | 2022-07-12 15:59 | 2022-07-19 11:01 |
| Reporter | (ALTech) JunGyu Kim | Assigned To | (SW) Kerwin Chen | Due Date | |
| Priority | urgent | Severity | s4-minor | Reproducibility | always |
| Status | closed | Resolution | reopened | ||
| Summary | 0001509: [Smart3] Memory leak issue on systemcontrol process | ||||
| Description | Hi kerwin. The memory leak issue was found on systemcontrol process. Other vendors (INTEK, INNOPIA) do not increase systemcontrol's memory with the same steps. Therefore, it is necessary to check if the code modified by Foxconn is showing symptoms of a memory leak. https://jira.skbroadband.com/browse/BTFAML-1210 Reproduce step is below. 1. Go to sleep mode to push RCU power button. 2. Go to wake up mode to push RCU power button. 3. When wake up the STB, the systemcontrol's memory is increasing. //Go to Sleep dumpsys meminfo $(pidof systemcontrol) | grep 'TOTAL:' | awk '{print $2}' 4755 // Go to Wake up dumpsys meminfo $(pidof systemcontrol) | grep 'TOTAL:' | awk '{print $2}' 4763 | ||||
| Tags | No tags attached. | ||||
| Attach Tags | |||||
| User List |
(ALTech) SY Yoon , (ALTech) Younkwang Jung |
|---|
|
|
Hi Kerwin Memory issues are very sensitive right now. Please check if the code below causes memory leak. ( check the pResultBuf in the generateEdidXmlFile() function. ) platform-vendor-amlogic-common/frameworks/services/systemcontrol/HDCP# vi HDCPTxAuth.cpp =============================================================================================================== .. 68 static int saveFile(const char *path, char *buf, int bufLen) { 69 int fd, len = -1; 70 71 mode_t save_umask = umask(0133); 72 if ((fd = open(path, O_CREAT | O_RDWR | O_TRUNC, 0644)) < 0) { 73 SYS_LOGE("saveFile, open %s error(%s)", path, strerror(errno)); 74 umask(save_umask); 75 return len; 76 } 77 umask(save_umask); 78 79 len = write(fd, buf, bufLen); 80 close(fd); 81 return len; 82 } .. 246 void HDCPTxAuth::generateEdidXmlFile(void) 247 { 248 char* pResultBuf = NULL; 249 char tmpbuf[MAX_STR_LEN]={0}; 250 unsigned int resultSize=0; 251 unsigned int n=0; 252 unsigned int i=0; 253 const char *lineDelim = "\n"; 254 //EDID header 255 edidHeader_t edidHeader; 256 257 //Allocate a buffer to store xml 258 pResultBuf = (char*)malloc(MAX_EDID_FILE_SIZE); <==== Please check pResultBuf 259 if (!pResultBuf) { 260 SYS_LOGE("Fail to allocate buffer for generat EDID xml file"); 261 return; 262 } 263 memset(pResultBuf, 0, sizeof(pResultBuf)); .. 645 n = sprintf(pResultBuf+resultSize,"</supported_Color>\n</hdmi_edid>\n"); 646 if(n > 0) 647 resultSize += n; 648 else{ 649 SYS_LOGE("%s: sprintf fail\n",__FUNCTION__); 650 free(pResultBuf); 651 return; 652 } 653 saveFile(EDID_XML_FILE_PATH,pResultBuf,resultSize); <== Please check saveFile function and pResultBuf , there is no code to free pResultBuf 654 } .. ===================================================================================================================================== Thank you YK.Jung |
|
|
Hi YK, It is fixed and verified by dumpsys command. Patch is already committed to BitBucket. Thank you ! |
|
|
Hi kerwin, Please apply this patch to SWAN project. I think this issue will be same with SWAN. Thank you. |
|
|
Hi Mr. JunGyu Kim, The implementation is quite different on SWAN. Therefore, it can't be applied to SWAN. Thank you ~ |
|
|
Hi, Kerwin, SWAN used the edidinfo binary for generating the EDID xml file. And, there is generateEdidXmlFile function in vendor/foxconn/prebuilts/bin/edidinfo. To make clearly, could you please check the generateEdidXmlFile function in vendor/foxconn/prebuilts/bin/edidinfo? As you know already, the SWAN edidinfo author is Bcan. Thank you. |
|
|
Hi Sangmin, Please find the attached picture for SWAN implementation. Because SWAN uses a different implementation comparing to Eagle, we review the malloc() function in SWAN. Only one malloc() function is used as attached in the picture and is properly freed. |
|
|
Hi, River, Ok, Thank you. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2022-07-12 15:59 | (ALTech) JunGyu Kim | New Issue | |
| 2022-07-12 16:00 | (ALTech) JunGyu Kim | Issue Monitored: (ALTech) SY Yoon | |
| 2022-07-12 16:00 | (ALTech) JunGyu Kim | Issue Monitored: (ALTech) Younkwang Jung | |
| 2022-07-12 18:25 | (ALTech) Younkwang Jung | Assigned To | => (SW) Kerwin Chen |
| 2022-07-12 18:25 | (ALTech) Younkwang Jung | Status | new => assigned |
| 2022-07-12 19:17 | (ALTech) Younkwang Jung | Note Added: 0010351 | |
| 2022-07-12 19:19 | (ALTech) Younkwang Jung | Note Edited: 0010351 | View Revisions |
| 2022-07-13 09:39 | (SW) Kerwin Chen | Assigned To | (SW) Kerwin Chen => (ALTech) Younkwang Jung |
| 2022-07-13 09:39 | (SW) Kerwin Chen | Status | assigned => resolved |
| 2022-07-13 09:39 | (SW) Kerwin Chen | Resolution | open => fixed |
| 2022-07-13 09:39 | (SW) Kerwin Chen | Note Added: 0010355 | |
| 2022-07-19 08:38 | (ALTech) Younkwang Jung | Status | resolved => closed |
| 2022-07-19 09:56 | (ALTech) JunGyu Kim | Assigned To | (ALTech) Younkwang Jung => (SW) Kerwin Chen |
| 2022-07-19 09:56 | (ALTech) JunGyu Kim | Status | closed => feedback |
| 2022-07-19 09:56 | (ALTech) JunGyu Kim | Resolution | fixed => reopened |
| 2022-07-19 09:56 | (ALTech) JunGyu Kim | Note Added: 0010405 | |
| 2022-07-19 10:15 | (SW) Kerwin Chen | Note Added: 0010407 | |
| 2022-07-19 10:15 | (SW) Kerwin Chen | Assigned To | (SW) Kerwin Chen => (ALTech) JunGyu Kim |
| 2022-07-19 10:15 | (SW) Kerwin Chen | Status | feedback => acknowledged |
| 2022-07-19 10:37 | (ALTech) Sangmin Choi | Note Added: 0010408 | |
| 2022-07-19 10:38 | (ALTech) Sangmin Choi | Assigned To | (ALTech) JunGyu Kim => (SW) Kerwin Chen |
| 2022-07-19 10:54 |
|
Note Added: 0010410 | |
| 2022-07-19 10:54 |
|
File Added: SWAN_edidxml_malloc_review.jpg | |
| 2022-07-19 11:01 | (ALTech) Sangmin Choi | Note Added: 0010412 | |
| 2022-07-19 11:01 | (ALTech) Sangmin Choi | Status | acknowledged => closed |
